<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title></title>
</head>
<body>
<script>
    var num  = 10;
    var arr = [1,3,5,7,9];  //声明数组
    var arr = new Array(1,3,5);
    var textArr = ["刘备","诸葛亮","赵云","关羽","张飞"];
    console.log(textArr[3]); //使用数组
    console.log(textArr.length);  // 数组的长度
    for(var i = 0; i<textArr.length;i++)  // 遍历数组
    {
        console.log(textArr[i]);
    }

    for(var i= 0, len = textArr.length; i<len;i++)  // 遍历数组
    {
        console.log(textArr[i]);
    }
</script>
</body>
</html>